package com.xjy.headfirst.工厂模式;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author :辛纪元
 * @date :2022-06-13 19:24
 * description:披萨工厂类
 */

@Data
public abstract class Pizza {

    protected String name;

    protected Dough dough;

    protected Sauce sauce;

    protected List<String> toppings = new ArrayList<>();

    abstract void prepare2();

    public void prepare() {
        System.out.println("准备开始");
        for (String topping : toppings) {
            System.out.println("盖浇咯：" + topping);
        }

    }

    public void over() {
        System.out.println("准备结束");
    }

}
